﻿
namespace Aeon.Emulator
{
    /// <summary>
    /// Contains information about extended memory usage.
    /// </summary>
    public sealed class ExtendedMemoryInfo
    {
        #region Constructors
        /// <summary>
        /// Initializes a new instance of the ExtendedMemoryInfo class.
        /// </summary>
        /// <param name="bytesAllocated">Number of XMS bytes currently allocted.</param>
        /// <param name="totalBytes">Total number of XMS bytes.</param>
        internal ExtendedMemoryInfo(int bytesAllocated, int totalBytes)
        {
            this.bytesAllocated = bytesAllocated;
            this.totalBytes = totalBytes;
        }
        #endregion

        #region Public Properties
        /// <summary>
        /// Gets the number of XMS bytes currently allocated.
        /// </summary>
        public int BytesAllocated
        {
            get { return this.bytesAllocated; }
        }
        /// <summary>
        /// Gets the number of XMS bytes currently free.
        /// </summary>
        public int BytesFree
        {
            get { return this.TotalBytes - this.BytesAllocated; }
        }
        /// <summary>
        /// Gets the total number of XMS bytes.
        /// </summary>
        public int TotalBytes
        {
            get { return this.totalBytes; }
        }
        #endregion

        #region Private Fields
        private readonly int bytesAllocated;
        private readonly int totalBytes;
        #endregion
    }
}
